import request from '@/utils/request'

// 查询入库单明细列表
export function listOrder(query) {
  return request({
    url: '/inOutStock/inStockDetailOrder/list',
    method: 'get',
    params: query
  })
}

// 查询入库单明细详细
export function getOrder(id) {
  return request({
    url: '/inOutStock/inStockDetailOrder/' + id,
    method: 'get'
  })
}

// 新增入库单明细
export function addOrder(data) {
  return request({
    url: '/inOutStock/inStockDetailOrder',
    method: 'post',
    data: data
  })
}

// 修改入库单明细
export function updateOrder(data) {
  return request({
    url: '/inOutStock/inStockDetailOrder',
    method: 'put',
    data: data
  })
}
// 分配码货员
export function distributeYardageGoods(data) {
  return request({
    url: '/inOutStock/inStockDetailOrder/distributeYardageGoods',
    method: 'put',
    data: data
  })
}

// 删除入库单明细
export function delOrder(id) {
  return request({
    url: '/inOutStock/inStockDetailOrder/' + id,
    method: 'delete'
  })
}


// 查询码货单
export function getYardageGoodsTaskOrder(params) {
  return request({
    url: '/inOutStock/yardageGoodsTaskOrder/list',
    method: 'get',
    params
  })
}

// 删除拣货单
export function delYardageTask(id) {
  return request({
    url: '/inOutStock/yardageGoodsTaskOrder/' + id,
    method: 'delete'
  })
}

// 确认分配
export function checkPicker(id) {
  return request({
    url: '/inOutStock/inStockDetailOrder/confirmDistribute/' + id,
    method: 'put',
  })
}

// 查询库区对应码货员
export function getStorehouseAreaShipper(query) {
  return request({
    url: '/business/shipper/list',
    method: 'get',
    params: query
  })
}
